// 基于template/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{spinalCase ctrl.codeName}}-form-vo.ts.hbs生成
import { ControlVOBase } from '@/core';
import { transformValue } from '@/utils';
import { model } from './main-form-model';

export class FormControlVO extends ControlVOBase {
	constructor(data: any) {
		//  表单预置字段
		data.srfwfmemo = data['srfwfmemo'] ? data['srfwfmemo'] : '';
		data.srffrontuf = data['srffrontuf'] ? data['srffrontuf'] : '';
		super(data);
		//  表单自持属性
		this.$ownKeys = [
			'srforikey',
			'srfkey',
			'srfmajortext',
			'srftempmode',
			'srfuf',
			'srfdeid',
			'srfsourcekey',
			'client_name',
			'client_id',
			'client_secret',
			'web_server_redirect_uri',
			'authorized_grant_types',
			'scope',
			'autoapprove',
			'authorities',
			'access_token_validity',
			'refresh_token_validity',
		];
	}
	get srfkey() {
		return this.$DO.client_id;
	}
	set srfkey(value: any) {
		this.$DO.client_id = value;
	}
	get srfmajortext() {
		return this.$DO.client_id;
	}
	set srfmajortext(value: any) {
		this.$DO.client_id = value;
	}
	get client_name() {
		return this.$DO.client_name;
	}
	set client_name(value: any) {
		this.$DO.client_name = value;
	}
	get client_id() {
		return this.$DO.client_id;
	}
	set client_id(value: any) {
		this.$DO.client_id = value;
	}
	get client_secret() {
		return this.$DO.client_secret;
	}
	set client_secret(value: any) {
		this.$DO.client_secret = value;
	}
	get web_server_redirect_uri() {
		return this.$DO.web_server_redirect_uri;
	}
	set web_server_redirect_uri(value: any) {
		this.$DO.web_server_redirect_uri = value;
	}
	get authorized_grant_types() {
		return this.$DO.authorized_grant_types;
	}
	set authorized_grant_types(value: any) {
		this.$DO.authorized_grant_types = value;
	}
	get scope() {
		return this.$DO.scope;
	}
	set scope(value: any) {
		this.$DO.scope = value;
	}
	get autoapprove() {
		return this.$DO.autoapprove;
	}
	set autoapprove(value: any) {
		this.$DO.autoapprove = value;
	}
	get authorities() {
		return this.$DO.authorities;
	}
	set authorities(value: any) {
		this.$DO.authorities = value;
	}
	get access_token_validity() {
		return this.$DO.access_token_validity;
	}
	set access_token_validity(value: any) {
		this.$DO.access_token_validity = value;
	}
	get refresh_token_validity() {
		return this.$DO.refresh_token_validity;
	}
	set refresh_token_validity(value: any) {
		this.$DO.refresh_token_validity = value;
	}
	// 界面主键标识
	get oauth_client_details() {
		return this.$DO.client_id;
	}

	set oauth_client_details(value: any) {
		this.$DO.client_id = value;
	}

	//  工作流预置字段
	srfwfmemo: any;
	srffrontuf: any;

	//  无实体属性表单项
	get srftempmode() {
		return this.$DO.srftempmode;
	}

	set srftempmode(value: any) {
		this.$DO.srftempmode = value;
	}

	//  表单重复器

	/**
	 * 返回后台数据
	 *
	 * @return {*}
	 * @memberof FormControlVO
	 */
	public getDo() {
		return {
			srffrontuf: this.srffrontuf,
			client_name: this.$DO.client_name,
			client_id: this.$DO.client_id,
			client_secret: this.$DO.client_secret,
			web_server_redirect_uri: this.$DO.web_server_redirect_uri,
			authorized_grant_types: this.$DO.authorized_grant_types,
			scope: this.$DO.scope,
			autoapprove: this.$DO.autoapprove,
			authorities: this.$DO.authorities,
			access_token_validity: this.$DO.access_token_validity,
			refresh_token_validity: this.$DO.refresh_token_validity,
		};
	}
}
